#ifndef DEFINES_H
#define DEFINES_H



#include <QString>


static const int UNDEFINED = -1;


enum ItemCategory
{
    ItemCategory_Undefined = UNDEFINED,

    ItemCategory_FIRST = 0,

    ItemCategory_Root = ItemCategory_FIRST,
    ItemCategory_Group,
    ItemCategory_Item,

    ItemCategory_LAST = ItemCategory_Item
};


static const QString CATEGORY_UNDEFINED_NAME = QT_TRANSLATE_NOOP("AbstractItem", "Undefined Category");
static const QString CATEGORY_ROOT_NAME = QT_TRANSLATE_NOOP("AbstractItem", "Root");
static const QString CATEGORY_GROUP_NAME = QT_TRANSLATE_NOOP("AbstractItem", "Group");
static const QString CATEGORY_ITEM_NAME = QT_TRANSLATE_NOOP("AbstractItem", "Item");


static QString categoryToName(const int& category)
{
    switch (category)
    {
    case ItemCategory_Root:  return CATEGORY_ROOT_NAME;
    case ItemCategory_Group: return CATEGORY_GROUP_NAME;
    case ItemCategory_Item:  return CATEGORY_ITEM_NAME;
    default:                 return CATEGORY_UNDEFINED_NAME;
    }
}



static int nameToCategory(const QString& category_name)
{
    if (category_name.toLower() == CATEGORY_ROOT_NAME.toLower()) return ItemCategory_Root;
    if (category_name.toLower() == CATEGORY_GROUP_NAME.toLower()) return ItemCategory_Group;
    if (category_name.toLower() == CATEGORY_ITEM_NAME.toLower()) return ItemCategory_Item;

    return ItemCategory_Undefined;
}


#if 0
enum ItemType
{
    Undefined = -1,

    ItemType_FIRST = 0,
    Attribute = ItemType_FIRST,
    Skill,
    Feat,
    Special,

    ItemType_LAST = Special
};



static QString typeToName(const int& type)
{
    switch (type)
    {
    //case Campaign:  return QT_TR_NOOP("Campaign");
    case Attribute: return QT_TR_NOOP("Attribute");
    case Skill:     return QT_TR_NOOP("Skill");
    case Feat:      return QT_TR_NOOP("Feat");
    case Special:   return QT_TR_NOOP("Special Ability");
    default:        return QT_TR_NOOP("Undefined");
    }
}
#endif


#endif // DEFINES_H
